import {ElLoading, ElMessage} from "element-plus";
import {ref} from "@vue/reactivity";

export function showTips(tips:string, type:any) {
    ElMessage.closeAll();
    ElMessage({
        showClose: true,
        message: tips,
        type: type,/*"success" | "warning" | "error" | "info"*/
    });
}
export function successTips(tips:string) {
    ElMessage.closeAll();
    ElMessage({
        showClose: true,
        message: tips,
        type: "success",/*"success" | "warning" | "error" | "info"*/
    });
}

export function warningTips(tips:string) {
    ElMessage.closeAll();
    ElMessage({
        showClose: true,
        message: tips,
        type: "warning",/*"success" | "warning" | "error" | "info"*/
    });
}
const loading =ref()
export function showLoading(){
      loading.value = ElLoading.service({
        lock: true,
        text: '加载',
        background: 'rgba(0,0,0,0.7)',
    })
}
export function closeLoading(){
    loading.value.close()
}
